package com.kulv.junit;

import org.junit.After;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;

@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration(value = "src/com/kulv")
@ContextConfiguration(locations = { "classpath*:spring-mvc.xml","classpath*:applicationContext.xml" })
public class BaseTest {
	
	protected MockMvc mockMvc;  
	
	@Autowired 
	private WebApplicationContext wac;
	
	
	@Before  
    public void setUp() {  
        mockMvc = MockMvcBuilders.webAppContextSetup(wac).build();  
    }  
	
	@After
	public void destroy() {  
        mockMvc = null;
        wac = null;
    }

}
